import Cookies from 'js-cookie'

const TokenKey = 'hrsaas-ihrm-token' // 设置一个你自己的独一无二的key

const TimeKey = 'hrsaas-timestamp-key' // 时间戳名

export function getToken() {
  return Cookies.get(TokenKey)
}

export function setToken(token) {
  return Cookies.set(TokenKey, token)
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}

// 定义时间戳 用来判断token是否失效

export function getTimeKey() {
  return Cookies.get(TimeKey)
}

export function setTimeKey() {
  return Cookies.set(TimeKey, Date.now())
}
